Method, equipment, and medium for displaying content

ABSTRACT

The present disclosure relates to a method, device and terminal for displaying content, and a medium, used for completely displaying content entered by a user when a content including many characters is entered in an input box, so as to avoid tedious operation when the user views the entered content which is not displayed. The method for displaying content of the present disclosure includes: receiving target content entered in a first display region; calculating an occupancy rate based on the target content and the first display region in real time; reducing a font size of the target content in response to that the occupancy rate satisfies a first condition; generating a second display region for displaying the target content in response to that the occupancy rate satisfies a second condition.

CROSS-REFERENCE TO RELATED APPLICATION

This application is based on and claims priority under 35 U.S.C 119 toChinese Patent Application No. 201910826725.9, filed on Sep. 3, 2019, inthe China National Intellectual Property Administration. The entiredisclosure of the above application is incorporated herein by reference.

FIELD

The present disclosure relates to the field of application softwaretechnology, in particular to a method, terminal, and a medium fordisplaying content.

BACKGROUND

In the related art, when content entered to electronic equipment (suchas a mobile phone) exceeds the width of an input box in the electronicequipment, the exceeding content overflows, and a display focus movesbackwards, that is, the displayed content is in a current enteredposition. when a content including many characters is entered in theinput box, interaction is tedious and use is inconvenient.

SUMMARY

According to an embodiment of the present disclosure, provided is amethod for displaying content, including:

receiving target content entered in a first display region;

calculating an occupancy rate based on the target content and the firstdisplay region in real time;

reducing a font size of the target content in response to that theoccupancy rate satisfies a first condition; and

generating a second display region for displaying the target content inresponse to that the occupancy rate satisfies a second condition.

In a possible implementation, according to the method for displayingcontent provided by the present disclosure, the calculating theoccupancy rate based on the target content and the first display regionin real time comprises:

calculating the occupancy rate in real time based on at least one of:

a length of the target content and a length of the first display region;

an area of the target content and an area of the first display region;and/or

a character number of the target content and a preset character numberof the first display region.

In a possible implementation, according to the method for displayingcontent provided by the present disclosure, the first condition is thatthe occupancy rate is greater than a preset threshold.

In a possible implementation, according to the method for displayingcontent provided by the present disclosure, the second condition is thatthe occupancy rate is greater than the preset threshold and the fontsize of the target content is the minimum font size.

In a possible implementation, according to the method for displayingcontent provided by the present disclosure, the method further includes:displaying the target content with the minimum font size in the seconddisplay region.

In a possible implementation, according to the method for displayingcontent provided by the present disclosure, the reducing the font sizecomprises: determining a reduced font size; and reducing the font sizeto the reduced font size in a fixed interval.

In a possible implementation, according to the method for displayingcontent provided by the present disclosure, the method further includes:displaying the target content with the reduced font size in the firstdisplay region, in response to that the reduce font size is not theminimum font size.

According to an embodiment of the present disclosure, provided is aterminal for displaying content, including:

a processor; and

a memory configured to store one or more instructions executed by theprocessor;

wherein the processor is configured to execute the instructions toperform the method for displaying content disclosed above.

According to an embodiment of the present disclosure, provided is astorage medium, configured to store one or more instructions which areexecuted by a processor of a terminal for displaying content to performthe method for displaying content disclosed in the embodiment of thepresent disclosure.

According to an embodiment of the present disclosure, provided is acomputer program product, including:

a processor; and

a memory configured to store one or more instructions executed by theprocessor;

wherein the processor is configured to execute the instructions toperform the method for displaying content disclosed above.

BRIEF DESCRIPTION OF THE DRAWINGS

Accompanying drawings here, which are incorporated in and constitute apart of this specification, illustrate embodiments consistent with thepresent disclosure and, together with the description, serve to explainprinciples of the present disclosure and do not constitute aninappropriate limitation on the present disclosure.

FIG. 1 is an effect drawing of a method for displaying content in therelated art.

FIG. 2 is a schematic diagram of a method for displaying contentaccording to an embodiment of the disclosure.

FIG. 3 is an effect drawing of a first display region and a seconddisplay region in a method for displaying content according to anembodiment of the disclosure.

FIG. 4 is a schematic diagram of another method for displaying contentaccording to an embodiment of the disclosure.

FIG. 5 is an effect drawing of a method for displaying content accordingto an embodiment of the disclosure.

FIG. 6 is a schematic diagram of yet another method for displayingcontent according to an embodiment of the disclosure.

FIG. 7 is a block diagram of an example of a terminal for displayingcontent according to an embodiment of the disclosure.

FIG. 8 is a block diagram of a structure of a terminal for displayingcontent according to an embodiment of the disclosure.

DETAILED DESCRIPTION OF THE EMBODIMENTS

In order to enable those of ordinary skill in the art to betterunderstand technical solutions of the present application, the technicalsolutions in embodiments of the present application will be clearly andfully described in combination with the accompanying drawings.

It should be noted that terms “first”, “second” and the like in thedescription, claims and above-mentioned accompanying drawings of thepresent disclosure are used for distinguishing similar objects and notfor describing a specific order or sequence. It should be understoodthat data used in such a way are interchangeable under appropriatecircumstances, so that the embodiments of the present disclosuredescribed herein can be implemented in the order other than thoseillustrated or described herein. The embodiments described in thefollowing exemplary embodiments do not represent all embodimentsconsistent with the present disclosure. Contrarily, they are merelyexamples of devices and methods consistent with some aspects of thepresent disclosure described in details in the appended claims.

Currently, in some electronic equipment, when content is entered by theuser to display, such as a payment amount entered during an electronicpayment process and communication content entered during an instantmessaging process, by a user is displayed according to differentapplication scenes. The length of the content entered may be limited byan input range in an interface in actual scenes.

As shown in FIG. 1, in an input box for entering cash withdrawal amountin an interface of electronic cash withdrawal, at most seven charactersin a default font size can be entered. When the length of the contententered by the user exceeds the length of the input box, in the relatedart, the content exceeding the input box overflows out of the input box,meanwhile, a display focus moves backwards, and the entered content withthe same length as the input box before the display focus can bedisplayed.

If “123456789” is entered in the interface of electronic cash withdrawalas shown in FIG. 1, the user continues entering the eighth and ninthcharacters in the default font size after the seventh character in thedefault font size is entered. At the moment, the display focus is at theninth character, and the content of the ninth character and the sixcharacters, namely “3456789”, before the ninth character can becompletely displayed, but the two exceeding characters ‘12’ may overflowout of the input box, that is, the first character “1” is not displayedat all, and the second character “2” is only partially displayed withoutbeing completely displayed.

In the scene above, if the content of the part that is not displayed inthe input box needs to be modified, the display focus (for example, acursor for indicating an input position) needs to be moved to theposition where the content needs to be modified, so that the modifiedcontent can be displayed in the input range, and therefore, when theentered content is modified, operation for modifying is tedious due tothe fact that all the entered content cannot be completely displayed.

In conclusion, in the related art, when the content entered by the userexceeds the input box, the entered content cannot be completelydisplayed, so that when the user views the entered content or modifiesthe content exceeding the input box, an interactive operation process istedious and use is inconvenient.

Therefore, an embodiment of the present disclosure provides a scheme fordisplaying content, which is used for completely displaying all theentered content when much content is entered in the input box andsimplifying the interactive operation process of viewing and modifyingthe entered content, and is convenient to use.

FIG. 2 is a schematic diagram of a method for displaying content asshown in an embodiment of the disclosure. As shown in FIG. 2, the methodfor displaying content includes the following steps S201 to S204.

Step S201, receiving target content entered in a first display region.

In some embodiments, the target content entered by the user is received,wherein the target content may be all the content (such as words,letters, numbers, symbols and expressions) entered by the user once ormultiple times, and the content displayed in the first display region isthe entered target content.

The first display region may be an input box, a suspension box or amovable input box. The first display region is used for displaying allthe entered content. The first display region may be configured to befixed in length and height according to actual application scenerequirements. The shape, length and height of the first display regionare not limited in the embodiment of the present disclosure.

It should be noted that when the target content is displayed in thefirst display region, the font size of the target content may bechanged. Specifically, the font size of the target content may bechanged within a certain range, for example, a maximum font size and aminimum font size are preset, and the font size of the target contentdisplayed may be any font size between the maximum font size and theminimum font size.

When the content displayed in the first display region is not empty orthe target content entered by the user is not received for the firsttime, the font size of the target content displayed in the first displayregion is the current font size. When the target content entered by theuser is not received, the content displayed in the first display regionis empty (or may also be preset displayed content, for example, “pleaseenter search content” and the like is displayed in the first displayregion). When the target content entered by the user is received for thefirst time, the step S202 below may be executed after the target contentis displayed in the first display region in the preset default fontsize, or the target content may be displayed in the first display regionafter the step S203 below is executed according to the fact that thefont size of the entered target content is the preset default font size.

Step S202, calculating an occupancy rate based on the target content andthe first display region in real time. Wherein the term “in real time”means that the ratio is recalculated once the target content changes,such as the front size of the target content changes.

In some embodiments, the occupancy rate is calculated based on at leastone of: a length of the target content and a length of the first displayregion; an area of the target content and an area of the first displayregion; and/or a character number of the target content and a presetcharacter number of the first display region.

Step S203, reducing a font size of the target content in response tothat the occupancy rate satisfies a first condition, wherein the firstcondition is that the occupancy rate is greater than a preset threshold.The method may further include: displaying the target content with thereduced font size in the first display region, in response to that thereduce font size is not the minimum font size.

In some embodiments, the font size of the target content is reduced tothe reduced front size in a fixed interval, wherein the fixed intervalis the font size interval. Before The front size of the target contentis reduced, the front size which should be reduced of the target contendmay be determined.

In some embodiments, in the condition that the font size of the targetcontent is reduced, the occupancy rate based on the target content andthe first display region is recalculated.

In some embodiments, whether the occupancy rate meets the firstcondition is determined. When it is determined that the occupancy ratemeets the first condition, the font size of the content displayed in thefirst display region is reduced, and the target content is completelydisplayed in the first display region, so that the target content iscompletely displayed in the first display region, interactive operationwhen the target content is viewed and modified is simplified, and use isconvenient. Wherein the first condition is that the occupancy rate isgreater than a preset threshold. For example, in response to that theoccupancy rate is greater than a preset threshold, the font size of thetarget content is reduced. In the condition that the font size of thetarget content is reduced, the occupancy rate based on the targetcontent with the reduced front size and the first display region isrecalculated.

It should be noted that after the font size of the content displayed inthe first display region is reduced, whether the occupancy raterecalculated still meets the first condition may be determined again,that is, the operation of determining whether the occupancy rate meetsthe first condition may be a cyclically executable process, and whetherthe occupancy rate meets the first condition may be determined againafter the font size is reduced, or a determining interval may also beset, and whether the occupancy rate meets the first condition isperiodically determined according to the fixed interval (for example,0.5 second), which aims at ensuring that the target content entered bythe user is completely displayed in the first display region in realtime, display overflow is avoided, and all the content can be viewedconveniently.

In some embodiments, the occupancy rate which is calculated in real timemay include at least one of:

the ratio of the length of the target content to the length of the firstdisplay region;

the proportion of the area of the target content to the area of thefirst display region; or

the ratio of the number of the characters of the target content to thepreset character number of the first display region.

In some embodiments, the preset threshold may be set according to actualconditions. For example, the preset threshold is 0.9. The presetcharacter number of the first display region may also be set accordingto actual situations, for example, for the input box as shown in FIG. 1,the preset character number may be 7.

In some embodiments, during the operation of determining whether theoccupancy rate meets the first condition, when the target contententered by the user is received for the first time, whether the firstcondition is met is determined under the condition that the targetcontent is in the preset default font size, and when the target contententered by the user is not received for the first time, whether thefirst condition is met is determined under the condition that the targetcontent is the current font size.

The first display region is configured to display in a single row. Thelength of the first display region can be obtained according to thepre-configured length and height of the first display region. The fontsize of the displayed content of the first display region can bechanged. The length of a single object (such as the word, letter,number, symbol and expression) displayed in the certain font size can bedetermined according to the width of each pre-configured font size. Thelength of the target content, namely the sum of the lengths of all theobjects in the target content, is determined according to the length ofthe single object in combination with the number of the objects includedin the target content.

Step S204: generating a second display region for displaying the targetcontent in response to that the occupancy rate satisfies a secondcondition. Wherein the second condition is that the occupancy rate isgreater than the preset threshold and the font size of the targetcontent is the minimum font size. The method further includes: after thestep S204, the target content with the minimum font size is displayed inthe second display region.

If the ratio of the length of the target content to the length of thefirst display region is greater than the preset threshold and the fontsize of the target content is the minimum font size, it is determinedthat the target content cannot be completely displayed in the firstdisplay region; and if the ratio of the length of the target content tothe length of the first display region is not greater than the presetthreshold, it is determined that the target content can be completelydisplayed in the first display region, wherein the preset threshold(e.g., 0.85) may be an empirical value and can also be determinedaccording to a test result in the actual application scene.

The first display region is configured to display in multiple rows, thearea of the first display region can be determined according to thepre-configured length and height of the first display region, the areaof the single object displayed in any font size can be determinedaccording to the width and the height of each pre-configured font size.The area of the target content, namely the sum of the areas of all theobjects in the target content, is determined according to the area ofthe single object in combination with the number of the objects includedin the target content.

The proportion of the target content in the first display region is aratio of the area of the target content to the area of the first displayregion. If the proportion of the target content in the first displayregion is greater than preset threshold, it is determined that thetarget content cannot be completely displayed in the first displayregion; and if the proportion of the target content in the first displayregion is not greater than the preset threshold, it is determined thatthe target content can be completely displayed in the first displayregion, wherein the preset threshold (e.g., 0.9) may be an empiricalvalue and can also be determined according to the test result in theactual application scene.

If the ratio of the character number of the target content to a presetcharacter number of the first display region is greater than the presetthreshold and the font size of the target content is the minimum fontsize, it is determined that the target content cannot be completelydisplayed in the first display region; and if the ratio of of thecharacter number of the target content to a preset character number ofthe first display region is not greater than the preset threshold, it isdetermined that the target content can be completely displayed in thefirst display region, wherein the preset threshold (e.g., 0.85) may bean empirical value and can also be determined according to a test resultin the actual application scene.

In the three modes, the determination is carried out by taking the ratioor proportion as reference, and in practical application, thedetermination may also be carried out by taking the number of thecharacters as reference. Specifically, if the number of the characters(e.g., the total number of characters, letters, numbers, symbols andexpressions) included in the target content is greater than the presetcharacter number, it can be determined that the target content cannot becompletely displayed in the first display region, and if the number ofthe characters included in the target content is not greater than thepreset character number, it is determined that the target content can becompletely displayed in the first display region.

Wherein the preset character number, namely the number of the charactersthat can be completely displayed in the first display region in the fontsize commonly used by the user, may be the ratio of the length of thefirst display region in the actual application scene to the width of thefont size commonly used by the user and obtained according to teststatistics. The preset character number, namely the number of thecharacters when the target content is completely displayed in the firstdisplay region in the preset default font size, may also be the ratio ofthe width of the first display region to the width of the preset defaultfont size. Or the preset character number may also be the ratio of thewidth of the first display region to the width of the default font sizeset by the user himself/herself, that is, the number of the characterswhen the target content is completely displayed in the first displayregion in the default font size set by the user himself/herself.

It should be noted that the first condition may be any one or more ofthe above conditions. Other conditions may also be set according to theactual application scenes. If the first condition is more than one ofthe above conditions and any one of the multiple conditions is met, itcan be deemed that the occupancy rate meets the first condition.

In practical application, when the font size of the content displayed inthe first display region is reduced, the font size of the contentdisplayed in the first display region may be reduced by a presetinterval for font size. For example, the preset font size range is fromNo. 10 to No. 1, the preset interval for font size is 1, and when thecurrent font size of the content displayed in the first display regionis assumed to be No. 6, after the font size of the content displayed inthe display region is reduced, the font size is No. 5.

When the font size of the content displayed in the display region isreduced, the font size of the content displayed in the first displayregion may also be gradually reduced by a preset pixel value. Forexample, assuming that the pixel value of the current font size of thecontent displayed in the first display region is 10, and the presetpixel value is 2, the pixel value of the font size is 8 after the fontsize of the content displayed in the display region is reduced.

When the font size of the content displayed in the display region isreduced, the font size of the content displayed in the first displayregion may also be gradually reduced by a preset ratio. For example,assuming that the current font size of the content displayed in thefirst display region is 5 mm wide and 8 mm long, and the preset ratio is0.8, the font size is 4 mm wide and 6.4 mm long after the font size ofthe content displayed in the display region is reduced.

In practical application, when the font size of the content displayed inthe display region is reduced, the font size may also be directlyreduced to the target font size, so that the target content can becompletely displayed directly in the reduced font size in the firstdisplay region, wherein the target font size may be determined throughthe following two implementation modes.

The first implementation mode is as follows: the first display region isconfigured to display in a single row; the number of the charactersincluded in the target content and the length of the first displayregion can be determined; the ratio of the length of the first displayregion to the number of the characters is calculated, wherein the ratiois the upper limit of the width of the font size when the target contentis completely displayed in the first display region; and the width ofthe font size proximate to the ratio may be matched in the preset fontsizes, and the matched font size is determined as the target font size.

The second implementation mode is as follows: the first display regionis configured to display in multiple rows; the number of the charactersincluded in the target content and the area of the first display regioncan be determined; the ratio of the area of the first display region tothe number of the characters is calculated, wherein the ratio may be theupper limit of the product of the width and length of the font size whenthe target content is completely displayed in the first display region;and the product of the width and length of the font size proximate tothe ratio may be matched in the preset font sizes, and the matched fontsize is determined as the target font size.

In a possible implementation, the target content is displayed in thecurrent font size in the first display region when it is determined thatthe target content does not meet the first condition.

In some embodiments, when it is determined that the target content doesnot meet the, e.g., the occupancy rate is not greater than the presetthreshold, that is, the target content entered by the user can becompletely displayed in the first display region, display overflow doesnot occur, the target content is displayed in the current font size inthe first display region.

In practical application, it is possible that the occupancy rate meetsthe first condition and the current font size is the preset minimum fontsize and cannot be reduced, in view of this, the method provided by thepresent disclosure may also include: establishing a second displayregion used for displaying content and displaying the target content inthe second display region when it is determined that the occupancy ratemeets the first condition and the font size of the content displayed inthe first display region is the preset font size (e.g. the minimum fontsize), wherein the display area of the second display region is greaterthan that of the first display region.

In some embodiments, when the occupancy rate meets the first condition,it is indicated that the target content cannot be completely displayedin the first display region, and at the moment. If the font size of thecontent displayed in the first display region is a preset minimum fontsize, the target content cannot be completely displayed in the firstdisplay region by reducing the font size. Then the second display regionis established, and the target content is displayed in the seconddisplay region.

For example, as shown in FIG. 3, it is determined that the targetcontent cannot be completely displayed in the first display region whenthe target content in the first display region in FIG. 3 meets the firstcondition, and the current font size is the preset minimum font size andcannot be continuously reduced, so the target content “I will try searchi will try search i will try search i will try search i will try searchi will try search i will try search i will try search i will try search”cannot be completely displayed in the first display region, and overflowoccurs. The second display region is established, and the target content“I will try search i will try search i will try search i will try searchi will try search i will try search i will try search i will try searchi will try search” is completely displayed in the second display region.

It should be noted that when the target content is displayed in thesecond display region, the preset minimum font size can be used, or thefont size when the target content is displayed can be determinedaccording to the set length and height of the second display region andthe number of the objects in the target content, or the target contentcan be displayed in the second display region in the preset default fontsize.

The second display region may be other containers such as a textbox, aninput box, a floating window, a container with a specific shape or acontainer with a specific effect, and is used for displaying all thetarget content, so that the user can view the entered contentconveniently. The user does not need to change the position of thedisplay focus when modifying the entered content, thus the user can viewall the entered content conveniently. Interactive operation issimplified, and user experience is improved.

FIG. 4 is a schematic diagram of a method for displaying content asshown in an embodiment of the disclosure. As shown in FIG. 4, the methodfor displaying content includes the following steps.

S401, receiving target content entered.

In some embodiments, when the user clicks the input box or inputinterface, that is, when the user triggers an input instruction, thetarget content entered by the user is received. In actual applicationscenes, the user can trigger the input instruction once or multipletimes; when the user triggers the input instruction once, the targetcontent entered by the user once is received; and when the user triggersthe input instruction multiple times, all the target content entered bythe user for multiple times is received.

S402, determining the length, height and current font size of thecurrent first display region.

In some embodiments, the first display region displays the targetcontent entered by the user, the first display region is configured tobe fixed in length and height according to actual application scenerequirements, and the font size of the displayed content may beconfigured to be the default font size. When the target content does notmeet the first condition, for example, when the proportion of the targetcontent in the first display region is smaller than the presetthreshold, the target content is displayed in the pre-configured defaultfont size.

The font size of the displayed content may be changed within a certainrange; the font size is changed between the preset maximum font size andthe preset minimum font size; and when the font size of the displayedcontent is not changed, the font size of the displayed content isdetermined as the current font size, and the displayed content isdisplayed in the current font size in the first display region.

When the font size of the displayed content is changed, the displayedcontent is displayed in the changed font size in the first displayregion. The length, height and font size of the first display region maybe pre-configured by an application program or a controller. The presetmaximum font size may be set as the preset default font size. If themaximum font size is not preset, the other font size in the interfacewhere the input box is located may be inherited as the maximum fontsize. If the minimum font size is not preset, the height of the minimumfont size may be two thirds of the height of the first display region;and the maximum font size and the minimum font size of the displayedcontent may also be pre-configured in a user-defined mode.

It should be noted that the font size of the displayed content may bechanged between the maximum font size and the minimum font size. Whenthe font size is changed, the font size may be changed by the presetinterval for font size, the preset pixel value or the preset proportion.The change of the font size of the displayed content includes reducingand increasing.

S403, calculating the proportion of the target content in the firstdisplay region.

In some embodiments, according to an actual application scene, a mode ofcalculating the proportion of the target content in the first displayregion is set. For example, when the first display region is set todisplay one row of content, the proportion of the target content in thefirst display region can be obtained by calculating the ratio of thetotal width of the target content to the width of the first displayregion, or, the proportion of the target content in the first displayregion is obtained by calculating the ratio of the number of thecharacters in the target content to the maximum number of the charactersdisplayed in the default font size in the first display region. When thefirst display region is set to display multiple rows of content, theproportion of the target content in the first display region can beobtained by calculating the ratio of the overall area of the targetcontent to the area of the first display region.

S404, determining whether the proportion of the target content in thefirst display region meets the first condition in real time, if yes,executing S405, and if no, executing S406.

Wherein the first condition is that the proportion of the target contentin the first display region is greater than a preset threshold. Forexample, the proportion of the length of the target content to thelength of the first display region is greater than the first presetthreshold; or, the proportion of the area of the target content to thearea of the first display region is greater than the second presetthreshold; or, the proportion of the number of the characters of thetarget content to the preset character number of the first displayregion is greater than the third preset threshold.

The first to third preset thresholds and the preset character number maybe empirical values. When the occupancy rate meets the first condition,it is determined that display overflow occurs in the condition that thetarget content is continuously displayed in the current font size, thatis, the target content cannot be completely displayed in the firstdisplay region, and the next step S405 is executed. if the targetcontent does not meet the first condition, it is determined that thetarget content can be completely displayed in the first display regionin the condition that the target content is continuously displayed inthe current font size, and S406 is executed in the next step. The firstto third preset thresholds may be one same value or different valuesrespectively.

S405, determining whether the current font size is the minimum fontsize, if yes, executing S408, and otherwise, executing S407.

In some embodiments, the font size may be changed within the rangebetween the maximum font size and the minimum font size. When thecurrent font size is the minimum font size, it is determined that thecurrent font size cannot be continuously reduced, and S408 is executedin the next step; and when the current font size is not the minimum fontsize, it is determined that the current font size can be continuouslyreduced, and S407 is executed in the next step.

S406, displaying the target content in the current font size in thefirst display region.

S407, reducing the current font size.

In some embodiments, the current font size may be reduced by the fontsize interval which is preset, or the current font size may be reducedby a preset pixel value (such as 2 pixels) or a preset change proportion(such as 0.85), that is, the width of the font size is changed into thewidth of the product of the width of the current font size and thepreset change proportion, and the length of the font size can becorrespondingly changed, or a length change proportion reduction valueis additionally set.

S408, establishing the second display region, and displaying the targetcontent in the second display region.

In some embodiments, when the occupancy rate meets the first condition,and the current font size is the minimum font size, that is, when thetarget content cannot be completely displayed in the first displayregion by reducing the font size of the content displayed in the firstdisplay region, the second display region is established, and the targetcontent is displayed in the second display region.

As shown in FIG. 3, when the proportion of the target content in thefirst display region is greater than the preset ratio threshold, thecurrent font size is the minimum font size, and the target contentcannot be completely displayed in the first display region, the seconddisplay region is established, and the target content is displayed inthe second display region.

It should be noted that the second display region may be othercontainers such as a textbox, an input box, a floating window, acontainer with a specific shape or a container with a specific effect(sound effect and rendering effect), and is used for displaying all thetarget content, so that the user can view the entered contentconveniently. The user does not need to change the position of thedisplay focus to view the target content when modifying the enteredcontent, thus interactive operation is simplified, and user experienceis improved.

S409, determining whether the proportion of the target content in thefirst display region meets the first condition meets the firstcondition, if yes, executing S405, and if no, executing S410.

In some embodiments, after the current font size of the target contentis reduced, the current font size is updated to be the reduced fontsize. Whether the target content displayed in the current font sizemeets the first condition can be determined again; if yes, it isdetermined that the target content in the reduced font size cannot becompletely displayed in the first display region, the font size needs tobe continuously reduced or the target content needs to be displayed inthe second display region, and S405 is executed in the next step; and ifno, it is determined that the target content in the reduced font sizecan be completely displayed in the first display region with no need ofcontinuously reducing the font size, and S410 is executed in the nextstep. Wherein whether the target content in the reduced font size meetsthe first condition is determined again so as to enable the targetcontent to be completely displayed in the first display region or seconddisplay region.

S410, displaying the target content in the reduced font size in thefirst display region.

In some embodiments, the target content is displayed in the firstdisplay region, and as shown in FIG. 5, the target content can bedirectly and completely displayed in the first display region byreducing the font size, so that the user can view the target contentconveniently, and does not need to move the display focus to view thetarget content, and thus user operation is simplified, and userexperience is improved.

In an actual application scene, after the user enters the content, thedisplayed content may be modified, such as adding the entered content orcutting the entered content, so that the target content modified by theuser needs to be determined in real time. The target content afteradding or cutting by the user needs to be displayed. After whether theoccupancy rate meets the condition is determined, whether the font sizeof the displayed content needs to be changed is determined, and themethod for displaying content shown in the embodiment can be implementedwhen the entered content is added.

FIG. 6 is a schematic diagram of a method for displaying content asshown in an embodiment of the disclosure when the user cuts the enteredcontent. As shown in FIG. 6, the method for displaying content includesthe following steps.

S601, determining the target content after deletion when a deletinginstruction is received.

In some embodiments, when the user clicks a delete key during anentering process, that is, when the user triggers the deletinginstruction, the target content after the user performs deletion isdetermined. In actual application scenes, the user can trigger thedeleting instruction once or multiple times; when the user triggers thedeleting instruction once, the target content after the user deletes thecontent of all the original displayed content once is determined; andwhen the user triggers the deleting instruction multiple times, thetarget content after the user deletes the content of all the originaldisplayed content for multiple times is determined.

It should be noted that the target content is the entered content afteractual adding or cutting by the user, namely the displayed content.

S602, determining the length, height and current font size of thecurrent first display region.

S603, calculating the proportion of the target content in the firstdisplay region.

In some embodiments, according to the actual application scene, a modeof calculating the proportion of the target content in the first displayregion is set. For example, when the first display region is set todisplay one row of content, the proportion of the target content in thefirst display region can be obtained by calculating the ratio of thetotal width of the target content to the width of the first displayregion, or, the proportion of the target content in the first displayregion is obtained by calculating the ratio of the number of thecharacters in the target content to the maximum number of the charactersdisplayed in the first display region in the default font size. When thefirst display region is set to display multiple rows of content, theproportion of the target content in the first display region can beobtained by calculating the ratio of the overall area of the targetcontent to the area of the first display region.

S604, determining whether the proportion of the target content in thefirst display region meets a determining condition, if yes, executingS605, and if no, executing S606.

In some embodiments, the determining condition may include more than oneof the following conditions. Wherein the determining condition is thatthe proportion of the target content in the first display region isgreater than a preset threshold.

For example, the proportion of the length of the target content to thelength of the first display region is not greater than the fourth presetthreshold; or the proportion of the area of the target content to thearea of the first display region is not greater than the fifth presetthreshold; or, the proportion of the number of the characters of thetarget content to the preset character number of the first displayregion is not greater than the sixth preset threshold. The fourth presetthreshold, the fifth preset threshold, the sixth preset threshold andthe preset character number may be empirical values. In someembodiments, the fourth preset proportion threshold is smaller than thefirst preset proportion threshold; and the fifth preset proportionthreshold is smaller than the second preset proportion threshold. Insome embodiments, the fourth to sixth preset thresholds may be one samevalue or different values respectively.

When the occupancy rate meets the determining condition, it isdetermined that if the target content is continuously displayed in thecurrent font size, the target content can be completely displayed in thefirst display region, and when the target content is displayed in thefirst display region, the proportion of the target content in the firstdisplay region is smaller than that of a blank part (a part of thecontent that is not displayed) of the content to be displayed in thefirst display region, so that it is inconvenient for the user to viewthe target content, and S605 is executed in the next step; if the targetcontent does not meet the first condition, it is determined that if thetarget content is continuously displayed in the current font size, thetarget content can be completely displayed in the first display region,and when the target content is displayed in the first display region,compared with the blank part of the content to be displayed, theproportion of the target content in the first display region isappropriate, so that it is convenient for the user to view the targetcontent, and S606 is executed in the next step.

S605, determining whether the current font size is the maximum fontsize, if yes, executing S606, and otherwise, executing S607.

In some embodiments, the font size may be changed within the rangebetween the maximum font size and the minimum font size. When thecurrent font size is the maximum font size, it is determined that thecurrent font size cannot be increased, and S606 is executed in the nextstep; and when the current font size is not the maximum font size, it isdetermined that the current font size can be increased, and S607 isexecuted in the next step.

S606, displaying the target content in the current font size in thefirst display region.

S607, increasing the current font size.

In some embodiments, the current font size may be increased by the fontsize interval which is preset, or the current font size may be increasedby a preset pixel value (such as 2 pixels) or a preset change proportion(such as 1.25), that is, the width of the font size is changed into thewidth of the product of the width of the current font size and thepreset change proportion, and the length of the font size may becorrespondingly changed, or a length change proportion increase value isadditionally set.

S608, determining whether the proportion of the target content in thefirst display region meets the first condition, if yes, executing S605,and if no, executing S609.

In some embodiments, after the current font size of the target contentis increased, the current font size is updated to be the increased fontsize. Whether the target content in the current font size meets thefirst condition may be determined again.

If yes, it is determined that the target content in the increased fontsize can be completely displayed in the first display region, and whenthe target content is displayed in the first display region, theproportion of the target content in the first display region is smallerthan that of the blank part of the content to be displayed in the firstdisplay region, so that it is inconvenient for the user to view thetarget content, the font size needs to be continuously increased, andS605 is executed in the next step.

If no, it is determined that the target content in the increased fontsize can be completely displayed in the first display region, and whenthe target content is displayed in the first display region, comparedwith the blank part of the content to be displayed, the proportion ofthe target content in the first display region is appropriate, so thatthe font size does not need to be continuously increased, and S609 isexecuted in the next step.

Whether the target content in the increased font size meets the firstcondition is determined again so as to enable the target content to becompletely displayed in first display region; and when the targetcontent is displayed in the first display region, compared with theblank part of the content to be displayed, the proportion of the targetcontent in the first display region is appropriate, so that it isconvenient for the user to view the target content.

S609, displaying the target content in the increased font size in thefirst display region.

It should be noted that after the target content is displayed in thesecond display region, and the user cuts the target content, theoccupancy rate meets the determining condition, that is, the targetcontent can be completely displayed in the first display region. Andwhen the target content is displayed in the first display region, theproportion of the target content in the first display region is smallerthan that of the blank part of the content to be displayed in the firstdisplay region, so that it is inconvenient for the user to view thetarget content, and the content displayed in the second display regioncan be emptied, or the second display region is not displayed while thecontent displayed in the second display region is emptied, for example,the container of the second display region disappears.

Based on the same concept of the embodiments of the present disclosurementioned above, FIG. 7 is a block diagram of a terminal for displayingcontent 800 as shown in an embodiment of the disclosure.

As shown in FIG. 7, the terminal for displaying content 800 shown in anembodiment of the present disclosure includes:

a processor 810; and

a memory 820 configured to store one or more instructions executed bythe processor 810;

wherein the processor 810 is configured to execute the instructions toperform the method for displaying content disclosed in the embodiment ofthe present disclosure.

In an embodiment of the disclosure, also provided is a storage mediumincluding one or more instructions, such as a memory 820 including theinstructions, wherein the instructions can be executed by the processor980 of the device for displaying content to perform the above-mentionedmethod. Optionally, the storage medium may be a non-transitorycomputer-readable storage medium, e.g., the non-transitorycomputer-readable storage medium may be a read-only memory, ROM, arandom access memory (RAM), a compactdisc read-only memory (CD-ROM), amagnetic tape, a floppy disk, optical data storage equipment and thelike.

In an embodiment of the present disclosure, as shown in FIG. 8, theembodiment of the present disclosure provides a terminal for displayingcontent 900 including components such as a radio frequency (RF) circuit910, a power supply 920, a processor 930, a memory 940, an input unit950, a display unit 960, a camera 970, a communication interface 980 anda wireless fidelity (WIFI) module 990. It should be understood by thoseskilled in the art that the structure of the terminal shown in FIG. 8does not constitute a limitation on the terminal, and that the terminalprovided by embodiments of the present application may include more orfewer illustrated components, or combination of the certain components,or different arrangements of the components.

Each component of the terminal 900 is described in detail below incombination with FIG. 8.

The RF circuit 910 can be used for receiving and sending data during acommunication or call process. Specifically, after receiving downlinkdata of a base station, the RF circuit 910 sends the data to theprocessor 930 for processing, and further sends uplink data to be sentto the base station. Generally, the RF circuit 910 includes, but is notlimited to, an antenna, at least one amplifier, a transceiver, acoupler, a low noise amplifier (LNA), a duplexer, etc.

In addition, the RF circuit 910 can also communicate with otherterminals through wireless communications and networks. The wirelesscommunications can use any communication standard or protocol including,but not limited to, global system of mobile communication (GSM), generalpacket radio service (GPRS), code division multiple access (CDMA),wideband code division multiple access (WCDMA), long term evolution(LTE), email, short messaging service or the like.

The Wi-Fi technology belongs to a short-range wireless transmissiontechnology, and the terminal 900 can be connected to an access point(AP) through the Wi-Fi module 990, so that the access to a data networkis realized. The Wi-Fi module 990 can be used for receiving and sendingdata during a communication process.

The terminal 900 may be physically connected to other terminals throughthe communication interface 980. Optionally, the communication interface980 is connected to the communication interfaces of the other terminalsthrough cables to achieve data transmission between the terminal 900 andthe other terminals.

In the embodiment of the present application, the terminal 900 canrealize communication service and send information to other contacts, sothat the terminal 900 needs to have a data transmission function, i.e.,the terminal 900 needs to include a communication module. Although FIG.8 shows communication modules such as the RF circuit 910, the Wi-Fimodule 990 and the communication interface 980, it should be understoodthat the terminal 900 includes at least one of the above components orother communication modules (e.g., Bluetooth modules) used forimplementing communication, to perform data transmission.

For example, when the terminal 900 is a mobile phone, the terminal 900may include the RF circuit 910 and may also include the Wi-Fi module990; when the terminal 900 is a computer, the terminal 900 may includethe communication interface 980 and may also include the Wi-Fi module990; and when the terminal 900 is a tablet computer, the terminal 900may include the Wi-Fi module.

The memory 940 may be configured to store software programs and modules.The processor 930 executes various functional applications and dataprocessing of the terminal 900 by running the software programs andmodules stored in the memory 940, and after the processor 930 executesprogram codes in the memory 940, some or all of the processes in FIGS.2, 4 and 6 of the present disclosure embodiment can be achieved.

In some embodiments, the memory 940 may mainly include a program storageregion and a data storage region, wherein the program storage region canstore an operating system, various application programs (such ascommunication applications), a face recognition module and the like; andthe data storage region can store data (such as multimedia files ofvarious pictures and video files, and face information templates) andthe like created according to the use of the terminal.

In addition, the memory 940 may include a high-speed random accessmemory, and may also include a non-volatile memory, such as at least onemagnetic disk storage device, flash memory device, or other volatilesolid-state storage device.

The input unit 950 can be used for receiving numerical or characterinformation entered by the user and generating a key signal inputrelated to user settings and functional control of the terminal 900.

Optionally, the input unit 950 may include a touch panel 951 and otherinput terminals 952, wherein the touch panel 951, also called a touchscreen, can collect touch operation of the user on or near the touchpanel 951 (such as user operation on or near the touch panel 951 byusing any suitable object or accessory such as a finger and a touchpen), and drive a corresponding connection device according to a presetprogram. Optionally, the touch panel 951 may include two parts: a touchdetection device and a touch controller, wherein the touch detectiondevice is used for detecting a touch orientation of the user, detectinga signal brought by the touch operation and transmitting the signal tothe touch controller; and the touch controller receives touchinformation from the touch detection device, converts the touchinformation into touch point coordinates, sends the touch pointcoordinates to the processor 930, and can receive and execute commandssent by the processor 930. In addition, the touch panel 951 can beimplemented in a variety of types, such as a resistive type, acapacitive type, an infrared type and a surface acoustic wave type.

Optionally, the other input terminals 952 may include, but is notlimited to, one or more of a physical keyboard, a function key (such asa volume control key and a switch key), a trackball, a mouse, a functionlever, etc.

The display unit 960 can be used for displaying information entered bythe user or information provided to the user, and various menus of theterminal 900. The display unit 960 is a display system of the terminal900 and is used for presenting an interface and realizing human-computerinteraction.

The display unit 960 may include a display panel 961. Optionally, thedisplay panel 961 may be configured in the form of a liquid crystaldisplay (LCD), an organic light-emitting diode (OLED), or the like.

Furthermore, the touch panel 951 can cover the display panel 961, andwhen detecting touch operation on or near the touch panel 951, the touchpanel 951 transmits the touch operation to the processor 930 todetermine the type of a touch event, and then the processor 930 providesa corresponding visual output on the display panel 961 according to thetype of the touch event.

Although in FIG. 8, the touch panel 951 and the display panel 961 areused as two independent components to implement input and outputfunctions of the terminal 900, in some embodiments, the touch panel 951and the display panel 961 may be integrated to implement the input andoutput functions of the terminal 900.

The processor 930 is a control center of the terminal 900, connects thevarious components by using various interfaces and circuits, executesthe various functions and processes data of the terminal 900 by runningor executing the software programs and/or modules stored in the memory940, and calling the data stored in the memory 940, and thus achievesmultiple kinds of service based on the terminal.

Optionally, the processor 930 may include one or more processing units.Optionally, the processor 930 may be integrated with an applicationprocessor and a modem, wherein the application processor is mainly usedfor processing the operating system, an user interface, an applicationprogram, etc., and the modem is mainly used for processing wirelesscommunication. It should be understood that the above-mentioned modemmay also not be integrated into the processor 930.

The camera 970 is used for achieving a shooting function of the terminal900, for shooting pictures or videos. The camera 970 may also be usedfor achieving a scanning function of the terminal 900, for scanning ascan object (a QR code/bar code).

The terminal 900 also includes a power supply 920 (such as a battery)for powering the various components. Optionally, the power supply 920can be logically connected to the processor 930 through a power supplymanagement system, so that the functions of managing charging,discharging, power consumption and the like can be achieved through thepower supply management system.

It should be noted that, in the embodiment of the present disclosure,the processor 930 can execute the functions of the processor 810 in FIG.8, and the memory 940 stores the content of the processor 810.

Besides, in an embodiment of the disclosure, the present disclosurefurther provides a storage medium, and when one or more instructions inthe storage medium is executed by the processor of the terminal fordisplaying content, the terminal for displaying content can implementthe method for displaying content in the embodiment of the presentdisclosure.

Other embodiments of the present disclosure will easily occur to thoseskilled in the art upon consideration of the specification and practiceof the present disclosure disclosed herein. The present disclosure aimsat covering any variation, application, or adaptive change of thepresent disclosure that follow the generic principles of the presentdisclosure and including common general knowledge or customary technicalmeans that the present disclosure does not disclose in the technicalfield. The specification and examples are to be regarded as beingexemplary only with the true scope and spirit of the present disclosurebeing indicated by the following claims.

It should be understood that the present disclosure is not limited tothe precise structures that have been described above and illustrated inthe accompanying drawings, and that various modifications and changescan be made without departing from the scope of the present disclosure.The scope of the present disclosure is limited only by the appendedclaims.

What is claimed is:
 1. A method for displaying content, comprising:receiving target content entered in a first display region; calculatingan occupancy rate based on the target content and the first displayregion in real time; reducing a font size of the target content inresponse to that the occupancy rate satisfies a first condition; andgenerating a second display region for displaying the target content inresponse to that the occupancy rate satisfies a second condition.
 2. Themethod according to claim 1, wherein said calculating the occupancy ratebased on the target content and the first display region in real timecomprises: calculating the occupancy rate in real time based on at leastone of: a length of the target content and a length of the first displayregion; an area of the target content and an area of the first displayregion; and/or a character number of the target content and a presetcharacter number of the first display region.
 3. The method according toclaim 1, wherein the first condition comprising: the occupancy rate isgreater than a preset threshold.
 4. The method according to claim 3,wherein the second condition comprising: the occupancy rate is greaterthan the preset threshold and the font size of the target content is theminimum font size.
 5. The method according to claim 4, furthercomprising: displaying the target content with the minimum font size inthe second display region.
 6. The method according to claim 4, whereinsaid reducing the font size comprises: determining a reduced font size;and reducing the font size to the reduced font size in a fixed interval.7. The method according to claim 6, further comprising: displaying thetarget content with the reduced font size in the first display region,in response to that the reduce font size is not the minimum font size.8. A terminal for displaying content, comprising: a processor; and amemory configured to store one or more instructions executed by theprocessor; wherein the processor is configured to execute theinstructions to: receive target content entered in a first displayregion; calculate an occupancy rate based on the target content and thefirst display region in real time; reduce a font size of the targetcontent in response to that the occupancy rate satisfies a firstcondition; and generate a second display region for displaying thetarget content in response to that the occupancy rate satisfies a secondcondition.
 9. The terminal according to claim 8, wherein the processorfurther is configured to: calculate the occupancy rate in real timebased on at least one of: a length of the target content and a length ofthe first display region; an area of the target content and an area ofthe first display region; and/or a character number of the targetcontent and a preset character number of the first display region. 10.The terminal according to claim 8, wherein the first conditioncomprising: the occupancy rate is greater than a preset threshold. 11.The terminal according to claim 10, wherein the second conditioncomprising: the occupancy rate is greater than the preset threshold andthe font size of the target content is the minimum font size.
 12. Theterminal according to claim 11, further comprising: displaying thetarget content with the minimum font size in the second display region.13. The terminal according to claim 11, wherein the processor further isconfigured to: determine a reduced font size; and reduce the font sizeto the reduced font size in a fixed interval.
 14. The terminal accordingto claim 13, wherein the processor further is configured to: display thetarget content with the reduced font size in the first display region,in response to that the reduce font size is not the minimum font size.15. A non-transitory computer-readable storage medium, configured tostore one or more instructions which are executed by a processor of aterminal for displaying content to: receive target content entered in afirst display region; calculate an occupancy rate based on the targetcontent and the first display region in real time; reduce a font size ofthe target content in response to that the occupancy rate satisfies afirst condition; and generate a second display region for displaying thetarget content in response to that the occupancy rate satisfies a secondcondition.
 16. The storage medium according to claim 15, wherein thestorage medium is further configured to store one or more instructionswhich are executed by a processor of a terminal for displaying contentto: calculate the occupancy rate in real time based on at least one of:a length of the target content and a length of the first display region;an area of the target content and an area of the first display region;and/or a character number of the target content and a preset characternumber of the first display region.
 17. The storage medium according toclaim 15, wherein the first condition comprising: the occupancy rate isgreater than a preset threshold.
 18. The storage medium according toclaim 17, wherein the second condition comprising: the occupancy rate isgreater than the preset threshold and the font size of the targetcontent is the minimum font size.
 19. The storage medium according toclaim 17, wherein the storage medium is further configured to store oneor more instructions which are executed by a processor of a terminal fordisplaying content to: displaying the target content with the minimumfont size in the second display region.
 20. The storage medium accordingto claim 15, wherein the storage medium is further configured to storeone or more instructions which are executed by a processor of a terminalfor displaying content to: display the target content with the reducedfont size in the first display region, in response to that the reducefont size is not the minimum font size.